//
//  HMHomeTitleButton.swift
//  sinaweibo
//
//  Created by WGP on 16/4/12.
//  Copyright © 2016年 WGP. All rights reserved.
//

import UIKit

class HMHomeTitleButton: UIButton {
    
    init(title: String)
    {
        super.init(frame: CGRectZero)
        
        self.setTitle(title, forState: .Normal)
        self.setTitleColor(UIColor.blackColor(), forState: .Normal)
        self.setImage(UIImage(named: "navigationbar_arrow_down"), forState: .Normal)
        self.adjustsImageWhenHighlighted = false
        self.sizeToFit()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        titleLabel?.frame.origin.x = 0
        
        imageView?.frame.origin.x = titleLabel!.frame.width + 5
    }
    
    
    
}
